#!/bin/bash

source /home/shell/util.sh



# 安装函数
function install () {
    requireJava
    source /etc/profile.d/java.sh
    
    file_name=$(curl -sL https://mirrors.tuna.tsinghua.edu.cn/apache/hive/stable-2/|grep -Po "apache-hive-.*?-bin.tar.gz"|uniq)
    download /opt/apache-hive.tar.gz https://mirrors.tuna.tsinghua.edu.cn/apache/hive/stable-2/${file_name}
    tar -xf /opt/apache-hive.tar.gz -C /opt/
    rm -rf /opt/apache-hive.tar.gz
    mv /opt/apache-hive-*-bin /opt/apache-hive
}

# 配置函数
function config(){
    echo 'config';
}

function run () {
    echo 'run';
}

# 运行安装和配置
install && config